import type { Params } from "@/types/common"
import { $baseApi } from "@/utils/http-instance"
import useCommonStore from "@/store/common"
const commonStore = useCommonStore()

// 景区列表
export const $getScenicList = (params: Params) =>
	$baseApi.get(`regions/${commonStore.region_id}/resort-sales/list-all-of-retail`, params)

// 景点详情
export const $getScenicDetail = (id: string) => $baseApi.get(`resort-sales/get-of-retail/${id}`)

// 景区产品
export const $getScenicProductList = (id: string, params: Params) =>
	$baseApi.get(`resort-sales/list-sale-menu-of-retail/${id}`, params)

// 所有启用的关联了景区的目的地页(带景区信息，景区列表筛选用)
export const $getPublicPageWithResort = (params: Params = {}) =>
	$baseApi.get(`regions/${commonStore.region_id}/publicity-pages/list-all-enabled-with-resorts`, params)

// 目的地列表
export const $getPublicityList = () => $baseApi.get(`regions/${commonStore.region_id}/publicity-pages/list-all-enabled`)

export const $getPublicityDetail = (id: string) => $baseApi.get(`publicity-pages/get-of-sale/${id}`)
